<?php
include_once "conn.php";
include_once "qzone.class.php";
$qid=is_numeric($_GET['qid'])?$_GET['qid']:exit('No Qid!');
$rs = $db->query("SELECT * FROM ".DB_PREFIX."qqs where qid='{$qid}' and (isvipqd>0 or islz>0 or isqb>0) and sidzt=0 limit 1");
if($row=$rs->fetch()){
	$uin=$row['qq'];
	$sid=$row['sid'];
	$skey=$row['skey'];
	$next=date("Y-m-d H:i:s",time()+60*60*8-10);
	$qzone=new qzone($uin,$sid,$skey);
	$sql='';
	if($row['isvipqd']) {
		$sql.="lastvipqd='$now',";
		$qzone->vipqd();
	}
	if($row['islz']) {
		$sql.="lastlz='$now',";
		$qzone->lzqd();
	}
	if($row['isqb']) {
		$sql.="lastqb='$now',";
		$qzone->pqd();
	}
	@$db->exec("update ".DB_PREFIX."qqs set {$sql}nextvipqd='$next' where qid='$qid'");
	exit('Ok!');
}else{
	exit('Qid Error!');
}
